Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a flag loader to allow flags to be set also via env vars #524

Merged
merged 3 commits into from
Feb 28, 2025

Conversation

tclemos
Copy link
Contributor

@tclemos tclemos commented Feb 28, 2025

Description

closes #521

allows current commands that depend on --rpc-url and --private-key flags to be set via env vars ETH_RPC_URL and PRIVATE_KEY respectively.

Testing

call any command that depends on --rpc-url or --private-key replacing the flag by the respective env var, the execution must happen exactly the same.

example:

# example 1 - regular flag usage
cdk ger dump --rpc-url https://sepolia.infura.io/v3/f694519bed4a476bbe8905b8c2e00ace --rollup-manager-address bali

# example 2 - inline env var set
$ ETH_RPC_URL="https://sepolia.infura.io/v3/f694519bed4a476bbe8905b8c2e00ace" cdk ger dump --rollup-manager-address bali

# example 3 - export
$ export ETH_RPC_URL="https://sepolia.infura.io/v3/f694519bed4a476bbe8905b8c2e00ace"
$ cdk ger dump --rollup-manager-address bali

@tclemos tclemos self-assigned this Feb 28, 2025
Copy link
Member

@leovct leovct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left a few comments :)

Tested ETH_RPC_URL and it seemed to work well!

@tclemos tclemos requested a review from leovct February 28, 2025 13:19
@tclemos tclemos merged commit 7d670ea into main Feb 28, 2025
6 checks passed
@tclemos tclemos deleted the thiago/env-vars branch February 28, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POLYCLI_RPC_URL env var
2 participants